package com.xr.pfm.demo.pfming;

import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.common.*;
import com.xr.common.BusinessTypeVar;
import com.xr.common.CommUtil;

/**
 * datasetListener
 */
public class datasetListener extends AbstractDatasetListener {
  public boolean beforeLoadData(Dataset dataset)
     throws Exception {

	  String sql="";
	  String className = dataset.parameters().getString("className");
	  SqlDataset ds = (SqlDataset) dataset;
	  if(className!=null && className.equals("pfmForAssessor_datasetEmpPfmResultList")){
		  sql=ds.getSql();
		  sql += CommUtil.setConditionSQL(ds)+" order by todoC desc";
		  ds.setSql(sql);
	  }
	  if(className!=null && className.equals("pfmForItemAssessor_datasetEmpPfmResultList")){
		  sql=ds.getSql();
		  sql += CommUtil.setConditionSQL(ds)+" order by todoC desc";
		  ds.setSql(sql);
	  }
	  
	  
    return true;
  }

}
